import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/investigation_plan_static_entity.dart';

InvestigationPlanStaticEntity $InvestigationPlanStaticEntityFromJson(Map<String, dynamic> json) {
  final InvestigationPlanStaticEntity investigationPlanStaticEntity = InvestigationPlanStaticEntity();
  final int? completedSchedule = jsonConvert.convert<int>(json['completedSchedule']);
  if (completedSchedule != null) {
    investigationPlanStaticEntity.completedSchedule = completedSchedule;
  }
  final int? missingInspectionPlan = jsonConvert.convert<int>(json['missingInspectionPlan']);
  if (missingInspectionPlan != null) {
    investigationPlanStaticEntity.missingInspectionPlan = missingInspectionPlan;
  }
  final int? quantityToBeCompleted = jsonConvert.convert<int>(json['quantityToBeCompleted']);
  if (quantityToBeCompleted != null) {
    investigationPlanStaticEntity.quantityToBeCompleted = quantityToBeCompleted;
  }
  return investigationPlanStaticEntity;
}

Map<String, dynamic> $InvestigationPlanStaticEntityToJson(InvestigationPlanStaticEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['completedSchedule'] = entity.completedSchedule;
  data['missingInspectionPlan'] = entity.missingInspectionPlan;
  data['quantityToBeCompleted'] = entity.quantityToBeCompleted;
  return data;
}

extension InvestigationPlanStaticEntityExtension on InvestigationPlanStaticEntity {
  InvestigationPlanStaticEntity copyWith({
    int? completedSchedule,
    int? missingInspectionPlan,
    int? quantityToBeCompleted,
  }) {
    return InvestigationPlanStaticEntity()
      ..completedSchedule = completedSchedule ?? this.completedSchedule
      ..missingInspectionPlan = missingInspectionPlan ?? this.missingInspectionPlan
      ..quantityToBeCompleted = quantityToBeCompleted ?? this.quantityToBeCompleted;
  }
}
